From: Florian Müllner Date: Sat, 29 Jun 2019 12:36:13 +0000 (+0200) Subject: ripples: Remove unreachable return statements X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~107 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6970f43e666f7f6f091a0829cbfbfb370d9d775e;p=gnome-shell.git ripples: Remove unreachable return statements Throwing an exception stops execution of the current function, so the following return statements are both unnecessary and unreachable. Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606 --- diff --git a/js/ui/ripples.js b/js/ui/ripples.js index 37d7362de..96abe181a 100644 --- a/js/ui/ripples.js +++ b/js/ui/ripples.js @@ -61,10 +61,8 @@ var Ripples = class Ripples { } addTo(stage) { - if (this._stage !== undefined) { + if (this._stage !== undefined) throw new Error('Ripples already added'); - return; - } this._stage = stage; this._stage.add_actor(this._ripple1); @@ -73,10 +71,8 @@ var Ripples = class Ripples { } playAnimation(x, y) { - if (this._stage === undefined) { + if (this._stage === undefined) throw new Error('Ripples not added'); - return; - } this._x = x; this._y = y;